<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // 2.拓展题：编写一个函数，返回一个对象，对象中包含任意URL中的get参数部分，例如： https://www.baidu.com/s?ie=utf-8&wd=html，则返回 {ie:’utf-8’,wd:’html’}。（考点：编程思维、字符串方法、对象操作）
        let q = "https://www.baidu.com/s?ie=utf-8&wd=html"
        let w = q.split("/")
        // console.log(w);
        let e = w[w.length - 1]
        // console.log(e);
        let r = e.split("?")
        // console.log(r);
        let t = r[r.length - 1]
        // console.log(t);
        let y = t.replace("=", ":'")
        // console.log(y);
        let u = y.replace("=", ":'")
        // console.log(u);
        let i = u.replace("&", "',") + "'"
        // console.log(i);
        let o = { i }
        console.log(o);
      





    </script>
</body>

</html>